<?php
/**
 * backend de logging vers une boite mail 
 * @package log 
 * @author Alain Vagner
 */
class MailAppender extends Appender
{
	public function write($logitem)
	{		
		
		$str  = 'Module: '.$logitem->module."\r\n";
		$str .= 'Date: '.date('Y-m-d H:i:s',$logitem->datetime)."\r\n";
		$str .= 'Description: '.$logitem->description."\r\n";
		$str .= 'Severity: '.$logitem->gravite."\r\n";
		$str .= 'File: '.$logitem->fichier."\r\n";
		$str .= 'Line: '.$logitem->no_ligne."\r\n";
	
		@mail($this->config, 'Warning', $str);
	
	}
}
?>
